package com.example.jfinalpluginactiverecord.jfinal_orm;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

//@PropertySource(value = {"classpath:datasource.properties"})
@PropertySource("classpath:jfinal_orm/config/datasource.properties")// 用来指定配置文件的位置
@Component// 以组件的方式使用，使用的时候可以直接注入
@ConfigurationProperties(prefix = "my.spring.datasource")
// 用来指定properties配置文件中的key前缀 比如my.spring.datasource    .username
//配置文件一点  要有 set方法
public class DataSourceConfig {
    private String username;
    private String url;
    private String password;

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }
}
